package com.ruoyi.system.controller;

import com.ruoyi.system.config.AliyunOSSUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.io.InputStream;

public class UploadController {
    //图片上传下载
    @RequestMapping("fileUpload")
    public String upload(MultipartFile file) throws IOException {
        String originalFilename = file.getOriginalFilename();
        InputStream inputStream = file.getInputStream();
        String s = AliyunOSSUtils.putObject(inputStream, originalFilename);
        return s;
    }
}
